import request from '@/utils/request.js'

/* 获取角色列表 */
export const getRoleList = (params) => {
	return request({
		url: '/sys/role',
		params
	})
}

/* 根据ID获取公司信息列表 */
export const getCompanyById = (id) => {
	return request({
		url: `/company/${id}`
	})
}

/* 根据ID删除角色 */
export const removeRoleById = (id) => {
	return request({
		url: `/sys/role/${id}`,
		method: 'delete'
	})
}
/* 根据ID获取角色信息 */
export const getRoleInfoById = (id) => {
	return request({
		url: `/sys/role/${id}`
	})
}

/* 根据ID编辑角色 */
export const updateRoleById = (id, data) => {
	return request({
		url: `/sys/role/${id}`,
		method: 'put',
		data
	})
}
/* 添加新角色 */
export const addRole = (data) => {
	return request({
		url: '/sys/role',
		method: 'post',
		data
	})
}

/* 根据ID编辑角色权限 */
export const updatePerById = (data) => {
	return request({
		url: '/sys/role/assignPrem',
		method: 'put',
		data
	})
}
